//
//  AttendanceView.m
//  SchoolTask
//
//  Created by feel on 16/8/25.
//  Copyright © 2016年 sm. All rights reserved.
//

#import "AttendanceView.h"
#import "UILabel+Method.h"

@interface AttendanceView ()

@property (nonatomic,retain) UILabel *DateLb;      //顶部显示日期
@property (nonatomic,retain) UILabel *timeLb;      //顶部显示时间
@property (nonatomic,retain) UILabel *classLb;     //课程名称
@property (nonatomic,retain) UILabel *addressLb;   //显示上课地址按钮
@property (nonatomic,retain) UIImageView *addressImage; //展示地点图片
@property (nonatomic,retain) UIImageView *nameImage;    //展示姓名按钮
@property (nonatomic,retain) UILabel *nameLb;           //显示姓名
@property (nonatomic,retain) UILabel *attendanceNub;    //展示文本 出勤人数
@property (nonatomic,retain) UILabel *attendanceInfo;   //显示具体出勤人数
@property (nonatomic,retain) UILabel *attendanceLb;     //显示签到是否成功
@property (nonatomic,retain) UILabel *attendance;       //显示具体签到原因
@property (nonatomic,retain) UILabel *presentation;     //展示温馨提示
@property (nonatomic,retain) UILabel *presentationInfo; //显示温馨提示语
@property (nonatomic,retain) UILabel *reasonLb;         //原因说明
@property (nonatomic,retain) UILabel *reasonInfo;       //原因说明信息
@property (nonatomic,retain) UIImageView *reasonImage;  //签到失败照片
@property (nonatomic,retain) UIButton *AddImageBt;      //添加图片按钮

@property (nonatomic,retain) UIView  *reasonView;       //承载底部框内控件

@property (nonatomic,retain) UILabel *lineLb1;           //细线
@property (nonatomic,retain) UILabel *lineLb2;
@property (nonatomic,retain) UILabel *lineLb3;

@end

@implementation AttendanceView

- (instancetype)init
{
    self = [super init];
    if (self) {
        
        self.frame = [UIScreen mainScreen].bounds;
        [self setController];
        
    }
    return self;
}

- (void)setController {

    _lineLb1 = [[UILabel alloc]initWithFrame:CGRectMake(0, 110, 1000, 1)];
    _lineLb2 = [[UILabel alloc]initWithFrame:CGRectMake(0, 260, 1000, 1)];
    _lineLb3 = [[UILabel alloc]initWithFrame:CGRectMake(0, 200, 1000, 1)];
    
    _lineLb3.backgroundColor = [UIColor colorWithRed:190/255.0 green:190/255.0 blue:190/255.0 alpha:1];
    _lineLb2.backgroundColor = [UIColor colorWithRed:190/255.0 green:190/255.0 blue:190/255.0 alpha:1];
    _lineLb1.backgroundColor = [UIColor colorWithRed:190/255.0 green:190/255.0 blue:190/255.0 alpha:1];
    
    
    CGRect rect = [UIScreen mainScreen].bounds;
    _reasonView = [[UIView alloc]initWithFrame:CGRectMake(10, 290, rect.size.width - 20, 300)];
    _reasonView.layer.cornerRadius = 10;
    _reasonView.layer.borderWidth  = 1;

    _DateLb     = [[UILabel alloc]initWithFrame:CGRectMake(20, 74, 100, 30)];
    _timeLb     = [[UILabel alloc]initWithFrame:CGRectMake(300, 74, 100, 30)];
    _classLb    = [[UILabel alloc]initWithFrame:CGRectMake(20, 104, 100, 50)];
    _addressLb  = [[UILabel alloc]initWithFrame:CGRectMake(50, 170, 100, 30)];
    _nameLb     = [[UILabel alloc]initWithFrame:CGRectMake(300, 170, 100, 30)];
    _reasonLb   = [[UILabel alloc]initWithFrame:CGRectMake(20, 380, 200, 50 )];
    _reasonInfo = [[UILabel alloc]initWithFrame:CGRectMake(120, 380, 100, 50)];
    _attendanceNub  = [[UILabel alloc]initWithFrame:CGRectMake(20, 200, 100, 50)];
    _attendanceInfo = [[UILabel alloc]initWithFrame:CGRectMake(150, 200, 100, 50)];
    _attendanceLb   = [[UILabel alloc]initWithFrame:CGRectMake(20, 290, 100, 50)];
    _attendance     = [[UILabel alloc]initWithFrame:CGRectMake(100, 290, 100, 50)];
    _presentation   = [[UILabel alloc]initWithFrame:CGRectMake(20, 330, 100, 50)];
    _presentationInfo =[[UILabel alloc]initWithFrame:CGRectMake(120, 330, 100, 50)];
    
    _nameImage = [[UIImageView alloc]initWithFrame:CGRectMake(250, 170, 30, 30)];
    _nameImage.image = [UIImage imageNamed:@"姓名图标"];
    _addressImage = [[UIImageView alloc]initWithFrame:CGRectMake(20, 170, 30, 30)];
    _addressImage.image = [UIImage imageNamed:@"位置图标"];
    
    _DateLb.text  = @"2016.10.10";
    _timeLb.text  = @"09:00";
    _classLb.text = @"语文";
    _classLb.font = [UIFont fontWithName:@"Helvetica-Bold" size:20];
    
    
    _nameLb.text        = @"三米";
    _addressLb.text     = @"中天国际";
    _attendanceNub.text = @"出勤人数";
    _attendanceNub.font = [UIFont systemFontOfSize:15];//采用系统默认文字设置大小
    _attendanceNub.font = [UIFont fontWithName:@"Helvetica-Bold" size:20];
    _attendanceLb.text  = @"签到失败";
    _attendanceLb.font  = [UIFont fontWithName:@"Helvetica-Bold" size:15];
    _attendance.text    = @"不在指定区域";
    _attendance.font    = [UIFont fontWithName:@"Helvetica-Bold" size:15];
    _presentation.text  = @"温馨提示";
    _presentation.font  = [UIFont fontWithName:@"Helvetica-Bold" size:15];
    _reasonLb.text      = @"原因说明";
    _reasonLb.font      = [UIFont fontWithName:@"Helvetica-Bold" size:15];
    _reasonInfo.text    = @"那是滴静安寺欧吉桑";
    _presentationInfo.text = @"你睡觉撒哈就爱速递易";
    _attendanceInfo.text   = @"20/60";
    
    _DateLb.textColor     = [UIColor colorWithRed:170/255.0 green:170/255.0 blue:170/255.0 alpha:1];
    _reasonInfo.textColor = [UIColor colorWithRed:170/255.0 green:170/255.0 blue:170/255.0 alpha:1];
    _timeLb.textColor     = [UIColor colorWithRed:170/255.0 green:170/255.0 blue:170/255.0 alpha:1];
    _classLb.textColor    = [UIColor colorWithRed:250/255.0 green:140/255.0 blue:0 alpha:1];
    _nameLb.textColor     = [UIColor colorWithRed:170/255.0 green:170/255.0 blue:170/255.0 alpha:1];
    _addressLb.textColor  = [UIColor colorWithRed:170/255.0 green:170/255.0 blue:170/255.0 alpha:1];
    _reasonLb.textColor   = [UIColor colorWithRed:250/255.0 green:140/255.0 blue:0 alpha:1];
    _attendance.textColor = [UIColor colorWithRed:250/255.0 green:140/255.0 blue:0 alpha:1];
    _presentationInfo.textColor   = [UIColor colorWithRed:170/255.0 green:170/255.0 blue:170/255.0 alpha:1];
    _reasonView.layer.borderColor = [[UIColor colorWithRed:190/255.0 green:190/255.0 blue:190/255.0 alpha:1] CGColor];
    _attendanceLb.textColor   = [UIColor colorWithRed:250/255.0 green:140/255.0 blue:0 alpha:1];
    _presentation.textColor   = [UIColor colorWithRed:250/255.0 green:140/255.0 blue:0 alpha:1];
    _attendanceNub.textColor  = [UIColor colorWithRed:250/255.0 green:140/255.0 blue:0 alpha:1];
    _attendanceInfo.textColor = [UIColor colorWithRed:170/255.0 green:170/255.0 blue:170/255.0 alpha:1];
    
    [self addSubview:_reasonView];
    [self addSubview:_DateLb];
    [self addSubview:_timeLb ];
    [self addSubview: _classLb];
    [self addSubview: _addressLb];
    [self addSubview: _nameLb];
    [self addSubview:_attendanceNub ];
    [self addSubview: _attendanceInfo];
    [self addSubview: _attendanceLb];
    [self addSubview: _attendance];
    [self addSubview: _presentation];
    [self addSubview: _presentationInfo];
    [self addSubview: _reasonLb];
    [self addSubview: _presentationInfo];
    [self addSubview:_reasonInfo];
    [self addSubview:_lineLb3];
    [self addSubview:_lineLb2];
    [self addSubview:_lineLb1];
    [self addSubview:_nameImage];
    [self addSubview:_addressImage];
}


- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    
    NSLog(@"tuoch");
    [self.delegate jump];
}

@end
